package com.asset.dispoal.business.bsAgreement.service;

import com.asset.dispoal.business.bsAgreement.api.BsAgreementService;
import com.asset.dispoal.business.bsAgreement.dto.AgreementDataRequest;
import com.asset.dispoal.business.bsAgreement.dto.AgreementDataResponse;
import com.asset.dispoal.business.bsAgreement.dto.AgreementRequest;
import com.asset.dispoal.business.bsAgreement.dto.AgreementResponse;
import com.asset.dispoal.business.bsAgreement.dto.EvidenceDataRequest;
import com.asset.dispoal.business.bsAgreement.dto.MergeDownloadRequest;
import com.asset.dispoal.business.bsAgreement.dto.MergeDownloadResponse;
import com.asset.dispoal.business.bsAgreement.service.commom.AgreementAbolishCaseCommand;
import com.asset.dispoal.business.bsAgreement.service.commom.AgreementCloseCaseCommand;
import com.asset.dispoal.business.bsAgreement.service.commom.AgreementResumeCommand;
import com.asset.dispoal.business.bsAgreement.service.commom.CaseTrackingCommand;
import com.asset.dispoal.business.bsAgreement.service.commom.PageMergeDownloadCommand;
import com.asset.dispoal.business.bsAgreement.service.commom.QueryAgreementCommand;
import com.asset.dispoal.business.bsAgreement.service.commom.QueryAgreementDataCommand;
import com.asset.dispoal.business.bsAgreement.service.commom.QueryEvidenceDataPageCommand;
import com.asset.dispoal.business.bsAgreement.service.commom.UpdateAgreementCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;

import java.util.List;

/**
 * @author qr
 * @date 2022/4/7$
 */
@Service
public class AgreementServiceImpl implements BsAgreementService {

    @Autowired
    QueryAgreementCommand queryAgreementCommand;
    @Autowired
    QueryAgreementDataCommand queryAgreementDataCommand;

    @Autowired
    UpdateAgreementCommand updateAgreementCommand;


    @Autowired
    CaseTrackingCommand caseTrackingCommand;


    @Autowired
    AgreementAbolishCaseCommand abolishCaseCommand;

    @Autowired
    private AgreementCloseCaseCommand agreementCloseCaseCommand;

    @Autowired
    private AgreementResumeCommand agreementResumeCommand;

    @Autowired
    private PageMergeDownloadCommand pageMergeDownloadCommand;

    @Autowired
    private QueryEvidenceDataPageCommand evidenceDataPageCommand;

    @Override
    public Result<List<AgreementResponse>> queryAgreement(AgreementRequest request) {
        Result<List<AgreementResponse>> execute = queryAgreementCommand.execute(request);
        return execute;
    }

    @Override
    public AgreementDataResponse queryAgreementData(String agreementId) {
        AgreementDataResponse agreementDataResponse = queryAgreementDataCommand.execute(agreementId);
        return agreementDataResponse;
    }

    @Override
    public Result updateAgreementData(AgreementDataRequest agreementDataRequest) {
        return updateAgreementCommand.execute(agreementDataRequest);
    }


    @Override
    public Result caseTracking(AgreementDataRequest agreementRequest) {
        return caseTrackingCommand.execute(agreementRequest);
    }

    @Override
    public Result abolishCase(String agreementId, String wasteReasonId) {
        return abolishCaseCommand.execute(agreementId, wasteReasonId);
    }

    @Override
    public Result caseClose(String agreementId) {
        return agreementCloseCaseCommand.execute(agreementId);
    }

    @Override
    public Result resumeState(String agreementId) {
        return agreementResumeCommand.execute(agreementId);
    }

    @Override
    public Result<PageVO<MergeDownloadResponse>> queryMergeDownload(MergeDownloadRequest request) {
        return pageMergeDownloadCommand.execute(request);
    }

    @Override
    public Result<PageVO<AgreementResponse>> queryEvidenceDataPage(EvidenceDataRequest request) {
        return evidenceDataPageCommand.execute(request);
    }
}
